package com.jmb.api.service;

import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jmb.api.common.exception.ParseException;
import com.jmb.api.model.entity.ApiTestCase;
import com.jmb.api.model.entity.ExecuteInterfaceCaseParam;
import com.jmb.api.model.vo.api.ApiTestCaseInfoVo;
import com.jmb.api.vo.api.ApiTestCaseVo;
import com.jmb.api.vo.api.test.ApiTestCaseListTO;
import com.jmb.api.vo.api.test.ApiTestCaseListVO;
import jakarta.validation.Valid;

/**
* @author jinbo
* @description 针对表【api_test_case】的数据库操作Service
* @createDate 2025-04-08 13:53:56
*/
public interface ApiTestCaseService extends IService<ApiTestCase> {

    void saveApiTest(ApiTestCaseVo apiTestCase);

    void editApiTest(@Valid ApiTestCaseVo apiTestCase);
    ApiTestCaseVo getApiTestCaseByCaseId(Integer caseId);
    IPage<ApiTestCaseListVO> getApiTestCaseList(IPage<ApiTestCaseListVO> page, ApiTestCaseListTO apiTestCaseVo);

    void removeByCaseId(Integer caseId);

    JSONArray caseTree(Integer level, Integer id);
    // 执行接口测试
    Integer executeCase(ExecuteInterfaceCaseParam executeInterfaceCaseParam) throws ParseException;

    ApiTestCaseInfoVo findInterfaceCaseByCaseId(Integer caseId);
}
